package tkaczyk.simtalk.pc;

import java.awt.Dimension;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import javax.swing.JFrame;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;

@SuppressWarnings("serial")
public class MainFrame extends JFrame {
	private ContentPane contentPane;
	
	public MainFrame(ContentPane contentPane) {
		super("SimTalk PC");
		
		this.contentPane = contentPane;
	}

	public void addNotify() {
		super.addNotify();

		contentPane.setPreferredSize(new Dimension(600, 600));
		setContentPane(contentPane);;

		setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
		addWindowListener(new WindowAdapter() {
			public void windowClosing(WindowEvent we) {
				System.exit(0);
			}
		});
	}
	
	public void CreateAndShow() throws Exception {
		UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
		SwingUtilities.updateComponentTreeUI(this);
		setMinimumSize(new Dimension(600, 400));
		setLocationRelativeTo(null);
		
		pack();
		setVisible(true);	
	}
}
